import {TOGGLE_SIDER_BAR_CLOSE_STATE, TOGGLE_SIDER_BAR_SHRINK_STATE} from "../action-types";

const initialState = {
    isSideBarHidden: __isClient__ ? window.screen.width < 768 : false,
    isSideBarMin: false
};
export const sideBarReducer = (state = initialState, action) => {
    const tempState = {
        isSideBarHidden: false,
        isSideBarMin: false
    };
    switch (action.type) {
        case TOGGLE_SIDER_BAR_CLOSE_STATE:
            tempState.isSideBarHidden = !state.isSideBarHidden;
            return tempState;
        case TOGGLE_SIDER_BAR_SHRINK_STATE:
            tempState.isSideBarMin = true;
            return tempState;
        default:
            return state
    }
};